<template>
	<view class="contentBox">
		
		<view class="status" :style="{height:`${statusHeight}px`}"></view>
		<view :style="{height:`${statusHeight}px`}" style="background-color: #FFFFFF;"></view>
		<view class="immgShell">
			<image class="portrait" :src="userData.headPortrait" mode=""></image>
		</view>
		<view style="background-color: #FFFFFF;height: 160rpx;"></view>
		<view class="content">
			<view class="imageBox" @click="deviceUrl('1')">
				<image src="../../static/image/moduleOne.png" mode=""></image>
				<text>设备列表</text>
			</view>
			<view class="imageBox" @click="deviceUrl('2')">

				<image src="../../static/image/moduleTwo.png" mode=""></image>
				<text>销售情况</text>
			</view>
			<view class="imageBox" @click="deviceUrl('3')">

				<image src="../../static/image/moduleTherr.png" mode=""></image>
				<text>商品信息</text>
			</view>


		</view>
		<view class="content_text">
			<text class="textTetil">基本信息</text>
			<!-- <view class="textRow">
				<text>场地</text>
				<text>上海MAO</text>
			</view> -->
			<view class="textRow">
				<text>权限</text>
				<text>{{userData.role_name}}</text>
			</view>
			<view class="textRow">
				<text>人员</text>
				<text>{{userData.customerName}}</text>
			</view>
			<view class="textRow">
				<text>手机号码</text>
				<text>{{userData.phone}}</text>
			</view>
		</view>

		<!-- 搜索框 -->
		<view class="inputBox">
			 
			<input type="text" @confirm="search" class="phoneInput" value="" v-model="phone" placeholder="请输入手机号码" />
			<image class="imgSearch" src="../../static/image/search.png" mode=""></image>
			<image @click="clear" class="imageClose" src="../../static/image/close.png" mode=""></image>
		</view>
		<TabBar current="1" />
	</view>
</template>

<script>
	import TabBar from "@/components/tabBar.vue"
	export default {

		data() {
			return {
				phone: '',
				statusHeight: 0, //状态栏
				userData: {
					role_name: '经理',
					customerName: '路人甲',
					phone: '52952042032',
					headPortrait:'../../static/logo.png'
				} //
			}
		},
		components: {
			TabBar
		},
		// created
		onLoad() {
			this.userData = uni.getStorageSync('userData').user
			console.log(this.userData)
		},
		// 刚开始 mounted
		onReady() {
			this.statusHeight = getApp().globalData.statusBarHeight
		},
		methods: {
			clear() {
				this.phone = ''
			},
			search(val) {
				if(this.userData == undefined) {
					return
				}
				console.log(this.phone)
				uni.navigateTo({
					url: "/pages/index/searchPage?phone=" + this.phone
				})
			},
			// 跳转到设备列表
			deviceUrl(type) {
				if (type == '1') {
					uni.navigateTo({
						url: "/pages/index/equipment"
					})
				} else if (type == '2') {
					// marketInfo
					uni.navigateTo({
						url: "/pages/index/marketInfo"
					})
				} else {
					uni.navigateTo({
						url: "/pages/index/goodsInfo"
					})
				}

			},
		}
	}
</script>

<style>
	@import url("./index.css");
</style>
